package com.xjm.utils;

public class UserContext {
    private static final ThreadLocal<Integer> userId = new ThreadLocal<>();

    public static void setUserId(Integer id) {
        userId.set(id);
    }

    public static Integer getUserId() {
        return userId.get();
    }

    public static void removeUserId() {
        userId.remove();
    }

    public static void clear() {
        removeUserId();
    }

}
